import request from '@/utils/request';
import type { AxiosPromise } from '@/utils/request';
import type { ContractReviewVO, ContractReviewForm, ContractReviewQuery } from '@/pagesA/api/workflow/contractReview/types';

/**
 * 查询令讯合同评审列表
 * @param query
 * @returns {*}
 */

export const listContractReview = (query?: ContractReviewQuery): AxiosPromise<ContractReviewVO[]> => {
  return request({
    url: '/workflow/contractReview/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询令讯合同评审详细
 * @param id
 */
export const getContractReview = (id: string | number): AxiosPromise<ContractReviewVO> => {
  return request({
    url: '/workflow/contractReview/' + id,
    method: 'get'
  });
};

/**
 * 新增令讯合同评审
 * @param data
 */
export const addContractReview = (data: ContractReviewForm) => {
  return request({
    url: '/workflow/contractReview',
    method: 'post',
    data: data
  });
};

/**
 * 修改令讯合同评审
 * @param data
 */
export const updateContractReview = (data: ContractReviewForm) => {
  return request({
    url: '/workflow/contractReview',
    method: 'put',
    data: data
  });
};

/**
 * 删除令讯合同评审
 * @param id
 */
export const delContractReview = (id: string | number | Array<string | number>) => {
  return request({
    url: '/workflow/contractReview/' + id,
    method: 'delete'
  });
};
